﻿-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
create PROCEDURE [dbo].[proc_ERP_Change_Apply]
	@Proposer NVARCHAR(50),
	@ProposerName NVARCHAR(50),
	@ProposeTitle VARCHAR(50),
	@ProposerCId INT,
	@ProposerDId INT,
	@ApplionTime DATETIME,
	@BDetails TEXT,
	@ADetails TEXT,
	@CAuditPerson NVARCHAR(50)
AS
	INSERT INTO ERP_DataChange
	(
		-- id -- this column value is auto-generated
		Proposer,
		ProposerName,
		ProposeTitle,
		PCompanyId,
		PDepartmentId,
		ApplionTime,
		BDetails,
		ADetails,
		CAuditPerson,
		--CAudit,
		--CMemo,
		--CAuditTime,
		--FAuditPerson,
		--FAudit,
		--FMemo,
		--FAuditTime,
		[State]
	)
	VALUES
	(
		@Proposer,
		@ProposerName,
		@ProposeTitle,
		@ProposerCId,
		@ProposerDId,
		@ApplionTime,
		@BDetails,
		@ADetails,
		@CAuditPerson,
		2 --提交至指定经理/主管审批
	)
RETURN
